package com.wpre.springioc.controller;

import com.wpre.springioc.component.UserComponent;
import com.wpre.springioc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-10-26
 * Time: 14:54
 */
@Controller
public class UserController {

    //属性注入:将UserService注入到UserController中
//    @Autowired
//    private UserService userService;


/*    //构造方法注入
    private UserService userService;
    //告诉Spring使用哪个构造方法
    @Autowired
    public UserController(UserService userService) {

        this.userService = userService;

    }

    public UserController() {

    }*/


//    //set方法注入
//    private UserService userService;
//
//    @Autowired
//    public void setUserService(UserService userService) {
//        this.userService = userService;
//    }
//
//    public void say() {
//        System.out.println("User Controller say");
//        userService.say();
//    }



}
